<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">        
        <script>
            $('form#login').submit(function(e){
                e.preventDefault();
                var username = document.getElementById("username").value;
                var password = document.getElementById("password").value;
                var page = "<?php echo $page ?>";
                var url = baseurl + "login/verify_login?username=" + username + "&password=" + password + "&page=" + page;
                $.ajax({
                    type: "POST",
                    url: url,
                    data: {
                        'username': username,
                        'password': password,
                        'page': page
                    },
                    success: function(data){
                        if(data == 'success'){
    //                            alert(data + page);
                            var url = baseurl + page;
                            window.location.href = url;
                        } else {
                            document.getElementById("message").innerHTML = "Incorrect username or password!";
                            document.getElementById("message").className = "danger label";
                        }
                    }
                })
                
            });
        </script>
    </head>
    <body>
        <!--<div class="container nopad">-->
            <div class="row">
                <div class="eight columns" style="
                     padding: 20px;
                     -webkit-border-radius: 5px;
                     margin: 15px 0 15px 0;
                     border: 2px;
                     border-style: solid;
                     border-color: #ddd;
                     background-color: white">
                    <h5 style="font-size: 20px; text-align: left; border-bottom: 2px solid #ddd; padding-bottom: 12px; margin-bottom: 8px"><strong>Sign In</strong></h5>
                    <form id="login" style="margin: 0px; text-align: left; overflow: hidden" action="" method="post">
                        <ul  style="text-align: left; overflow: hidden">
                            <li id="message"></li>
                            <li class="field">
                                <label class="" for="username">Username</label>
                                <input class="xwide text input" name="username" id="username" type="text" placeholder="Username" />
                            </li>
                            <li class="field">
                                <label class="" for="password">Password&nbsp;</label>
                                <input class="xwide text input" id="password" name="password" type="password" placeholder="password" />
                            </li>
                            <li><span style="color: red"><?php echo $this->session->flashdata('fail'); ?></span></li>
                            <li>
                                <div class="medium dark btn"><input type="submit" value="Login" /></div> &nbsp;&nbsp;&nbsp; <a href="<?php print base_url(); ?>login/forgetPassword" target="_blank">Forget Password?</a
                            </li>
                        </ul>
                    </form>
                </div>
                <div class="six columns" style="font-size: 12px">
                    <?php include 'public/include/web/sidebar_contact.php'; ?>
                </div>
            </div>
        <!--</div>-->
    </body>
</html>
